import logging
import yagmail
def log_test():
    logging.basicConfig(level=logging.DEBUG,format='%(message)s -> %(asctime)s',
                        handlers=[(logging.StreamHandler(),logging.FileHandler('log.txt'))])
def send_mail(filepath):
    mail=yagmail.SMTP(user='1641759621@qq.com',password='cypkpyfkayvfbcjh',host='smtp.qq.com')
    mail.send(to='1641759621@qq.com',subject='测试报告',contents='请查收',attachments=filepath)